package com.ruoyi.system.domain.vo;

import com.ruoyi.system.enums.LabelEnum;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class LabelVo {

    private String code;

    private String name;


    public static List<LabelVo> setLabel(String labels){
        List<LabelVo> list = new ArrayList<>();
        String[] split = labels.split(",");
        for (String s : split) {
            LabelVo vo = new LabelVo();
            vo.setCode(s);
            vo.setName(LabelEnum.getNameByCode(s));
            list.add(vo);
        }
        return list;
    }

}
